﻿using System;
using System.Windows.Forms;

namespace Onshi.POS.Formularios.Recursos
{
    public class MascaraBase : MaskedTextBox
    {
        #region Constructores

        public MascaraBase()
        {
            HandleCreated += new EventHandler(MascaraBase_HandleCreated);
        }

        #endregion

        #region Eventos

        private void MascaraBase_HandleCreated(Object sender, EventArgs e)
        {
            Font = Properties.Settings.Default.Fuente;
            CutCopyMaskFormat = MaskFormat.ExcludePromptAndLiterals;
            TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;
        }

        protected override void OnKeyUp(KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
                SendKeys.Send("{Tab}");
        }   

        #endregion
    }
}
